import {fetch} from '../fetch'
import config from "@/config"

class Role {
  constructor() {
  }

  static getRoutes(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/routes',
      method: 'post',
      params
    })
  }

  static list(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/role/list',
      method: 'post',
      params
    })
  }

  static detail(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/role/detail',
      method: 'post',
      params
    })
  }

  static add(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/role/add',
      method: 'put',
      params
    })
  }

  static update(params) {
    return fetch({
      url: config.baseUrl.adminSys + `/role/update/${params.id}`,
      method: 'post',
      params
    })
  }

  static delete(params) {
    return fetch({
      url: config.baseUrl.adminSys + `/role/delete/${params.id}`,
      method: 'delete',
      params
    })
  }
}

export default Role
